package fy.erp.check;

import com.seeyon.ctp.menu.check.AbstractMenuCheck;

import fy.form.listen.dao.MemberDao;



public class MenuForProjectExpenseReportsViewChecker extends AbstractMenuCheck {

	private static final String managerCode = "002218";

	private static long manager;

	private static boolean first = true;

	public boolean check(long memberId, long loginAccountId) {
		if (first) {
			first = false;
			manager = MemberDao.queryMemberIDByCode(managerCode).getId();
		}
		if (memberId == manager) {
			AllowMemberManager.getAllowMembers(true);
			return true;
		} else {
			long[] members = AllowMemberManager.getAllowMembers(false);
			if (members != null) {
				for (int i = 0, size = members.length; i < size; i++) {
					if (members[i] == memberId) {
						return true;
					}
				}
			}
		}
		return false;
	}

}
